//
//  PywSdk+center.m
//  PywSdk
//
//  Created by Jade on 16/11/14.
//  Copyright © 2016年 Jade. All rights reserved.
//

#import "PywSdk+center.h"
#import "PywPlatformMain.h"
#import <UIKit/UIKit.h>
#import "PywResourceUtils.h"
#import "PywNavgationController.h"
#import "PywUserViewController.h"

@implementation PywSdk (center)

- (void)showCenter {
    if (![PywPlatformMain sharedPlatformMain].logined) {
        UIAlertView *alert = [[UIAlertView alloc] initWithTitle:@"友情提示"
                                                        message:@"请您先登录再进入个人中心"
                                                       delegate:self
                                              cancelButtonTitle:@"确定"
                                              otherButtonTitles:nil, nil];
        [alert show];
        return ;
    }
    
    PywUserViewController *centerView = [[PywUserViewController alloc] init];
    PywNavgationController *nav = [[PywNavgationController alloc] initWithRootViewController:centerView];
    [[UIApplication sharedApplication].keyWindow.rootViewController presentViewController:nav animated:YES completion:NULL];
}
@end
